import csv
import getpath
import os
import openpyxl
import myglobal
import config_json
def getdata_raw(fname):
    xl_book = openpyxl.load_workbook(filename=fname)
    table = xl_book.worksheets[0]
    data = []
    for row in table.values:
        r = []
        for one in row:
            if one is not None:
                r.append(one)
            else:
                r.append(None)
        data.append(r)
    return data #None# dataframe1
def zl_data(data):
    data=data[4:]
    r1=[]
    r2=[]
    r3=[]
    for i in range(len(data)):
        row=data[i]
        r1.append((row[0],row[1]))
        r2.append((row[3],row[4]))
        r3.append((row[6],row[7]))
    return (r1,r2,r3)
def getdata(fname):
    #SID Value 1#Result
    data0=getdata_raw(fname)
    data=zl_data(data0)
    return data
def getdata0():
    fname=os.path.join(getpath.getpath(),"tempTable.xlsx")
    data=getdata(fname)
    return data
(cali1,cali2,cali3)=getdata0()
if __name__=="__main__":
    # data=getdata_std0()
    data=getdata0()
    print(data)
    print(data[0])
    print(data[1])
    print(data[2])
